#ifndef __NPC_H__
#define __NPC_H_
	
//ebreak
#define npc_trap(code) asm volatile("mv a0, %0; ebreak" : :"r"(code))

//device
#define UART_RX      (0x10000000)
#define UART_TX      (0x10000000)

#define UART_LCR_DIV (0x10000003) // LCR_DIV
#define UART_DIV_L   (0x10000000) // 低8bit
#define UART_DIV_H   (0x10000001) // 高8bit
#define UART_LSR	 (0x10000005) // LSR



// not implemented device
#define DEVICE_BASE 0xd0000000
#define MMIO_BASE   0xd0000000
#define RTC_ADDR        (DEVICE_BASE + 0x0000048)
#define KBD_ADDR        (DEVICE_BASE + 0x0000060)
#define VGACTL_ADDR     (DEVICE_BASE + 0x0000100)
#define AUDIO_ADDR      (DEVICE_BASE + 0x0000200)
#define DISK_ADDR       (DEVICE_BASE + 0x0000300)
#define FB_ADDR         (MMIO_BASE   + 0x1000000)
#define AUDIO_SBUF_ADDR (MMIO_BASE   + 0x1200000)

#endif
